<?php
function smarty_modifier_rewrite($type) {
	$args = func_get_args();
	array_shift($args);

	switch ($type) {
	case 'INDEX':
		$format = '/';
		break;
	case 'WAN':
		$format = '/wan';
		break;
	case 'MM':
		$format = '/mm';
		break;
	case 'XIANGQIN':
		$format = '/xiangqin';
		break;
	case 'BAOLIAO':
		$format = '/baoliao';
		break;
	case 'KANNB':
		$format = '/kannb';
		break;
	case 'JIFEN':
		$format = '/vip';
		break;
	case 'EXCHANGE':
		$format = '/jifen/exchange';
		break;
	case 'LOTTERY':
		$format = '/jifen/lottery';
		break;
	case 'PAIPAILE':
		$format = '/jifen/lucklottery';
		break;
	case 'AUCTION':
		$format = '/jifen/auction';
		break;
	case 'TASK':
		$format = '/task';
		break;

	case 'VISIT': //探店
		$format = '/meishi/explore';
		break;
	//case 'VISITPAGE'://探店内页
	//	$format = '/meishi/explore/%d.html';
	//	break;
	case 'VISIT_CONTRIBUTE': // 用户提交探店
		$format = '/home.php?model=SharePage&rsid=%d';
		break;
	case 'VISIT_PREVIEW': // 探店预览
		$format = '/publish/preview/%d';
		break;
	case 'ALBUMLIST'://美食榜单
		$format = '/meishi/album';
		break;
	case 'ALBUMPAGE'://榜单内页
		$format = '/meishi/album/%d';
		break;
	case 'SHOW_MEISHI'://秀美食
		$format = '/meishi/show';
		break;
	case 'SHOW_MEISHI_STYLE':
		$format = '/meishi/show/%d';
		break;

	case 'PLAZA'://商圈
		$format = '/plaza/%d';
		break;
	case 'PLAZA_TRAFFIC'://商圈 交通
		$format = '/plaza/%d/traffic';
		break;
	case 'PLAZA_GUIDE'://商圈 指南
		$format = '/plaza/%d/guide';
		break;
	case 'PLAZA_ACTIVITY'://商圈 活动
		$format = '/plaza/%d/event';
		break;
	case 'PLAZA_ACTIVITY_SHOW'://商圈 活动(内页)
		$format = '/plaza/event/%d.html';
		break;

	case 'MEISHI':
		$format = '/meishi'; //美食首页
		break;
	case 'MEISHI_DETAIL':
		$format = '/meishi/%d.html';
		break;

	//商家
	case 'RESTAURANTS':
		$format = '/shop';
		break;
	case 'RESTAURANTS_SEARCH':
		$format = '/shop/search/?';
		break;
	case 'RESTAURANT':
		$format = '/shop/%d';
		break;
	case 'RESTAURANT_PHOTO': //商家 照片 (列表页)
		$format = '/shop/%d/photo';
		break;
	case 'RESTAURANT_PHOTO_SHOW'://商家 照片 (展示页)
		$format = '/photo/%d.html';
		break;
	case 'RESTAURANT_PROMO'://商家 优惠 (列表页)
		$format = '/shop/%d/promo';
		break;
	case 'RESTAURANT_PROMO_SHOW'://商家 优惠 (展示页)
		$format = '/promo/%d.html';
		break;
	case 'RESTAURANT_EXPLORE'://商家 探店 (列表页)
		$format = '/shop/%d/explore';
		break;
	case 'RESTAURANT_REVIEW'://商家 点评 (列表页)
		$format = '/shop/%d/review';
		break;
	case 'RESTAURANT_BANKCARD_SHOW'://商家 银行卡优惠 展示页
		$format = '/promo/%d.html';
		break;

	//用户首页
	case 'SHOW_USER':
// 		$format = '/u/%d/share';
		$format = '/u/%d';
		break;

	//积分
	case 'PAIPAILE_DETAIL'://排排乐
		$format = '/jifen/%d.html';
		break;
	case 'MM_DETAIL'://微美女
		$format = '/mm/%d.html';
		break;

	case 'MY_CONTRIBUTE':
		$format = '/account/publish';
		break;

    case 'CITY':
        $format='/city';
        break;
	//同城活动
	case 'CITY_DETAIL'://活动内页
		$format='/city/%d';
		break;
    case 'CITY_INDEX'://同城活动列表
		$format='/city/%s';
		break;
    case 'CITY_POST_DATA'://提交作业
    	$format='/home.php?model=SharePage&t=rsv&cid=%d';
    	break;
    case 'CITY_POST_DETAIL'://查看作业
    	$format='/home.php?model=SharePage&ac=page&id=%d';
    	break;

	/// 会员设置
	case 'MEMBER_SET_BASIC':
		$format = '/set/basic'; // 基本信息
		break;
	case 'MEMBER_SET_AVATAR':
		$format = '/set/avatar'; // 修改头像
		break;
	case 'MEMBER_SET_PASSWORD':
		$format = '/set/password'; // 修改密码
		break;
	case 'MEMBER_SET_BIND':
		$format = '/set/bind'; // 帐号绑定
		break;
	case 'MEMBER_SET_DETAIL':
		$format = '/set/detail'; // 详细资料
		break;

	/// 消息
	case 'MSG_REPLY':
		$format = '/msg/reply/%d'; // 发出的评论
		break;
	case 'MSG_COMMENT':
		$format = '/msg/comment/%d'; // 收到评论
		break;
	case 'MSG_LIKE':
		$format = '/msg/like/%d'; // 收到的赞
		break;
	case 'MSG_SYSTEM':
		$format = '/msg/system/%d'; // 收到的系统消息
		break;
    	case 'MSG_PM':
		$format = '/msg/pm/%d'; // 收到的系统消息
		break;

	//分享
	case 'SHARE_PAGE':
		$format = '/share/%d';
		break;
	case 'SHARE':
		$format = '/share';
		break;
	case 'SHARE_LIST'://分享列表
		$format = '/u/%d/share';
		break;
	case 'PRAISE_LIST'://赞列表
		$format = '/u/%d/like';
		break;
	case 'COLLECT_LIST'://收藏列表
		$format = '/fav';
		break;

	// 好友
	case 'MY_FOLLOW':
		$format = '/u/%d/follow';
		break;
	case 'MY_FANS':
		$format = '/u/%d/fans';
		break;

	//WAP
	case 'WAP_SHARE_PAGE'://wap分享内页
		$format = '/wap/share/SharePage?id=%d';
		break;
    case 'WAP_SHARE_USER'://同城用户
		$format = '/wap/index/ShareUser?id=%d';
		break;
	case 'WAP_CITY_PAGE'://同城内页
		$format = '/wap/City/CityPage?id=%d';
		break;
    case 'WAP_CITY_USER'://同城用户
		$format = '/wap/City/CityUser?id=%d';
		break;
    case 'WAP_CITY_USER2'://同城用户
		$format = '/wap/city/CityUser?id=%d&type=1';
		break;
	case 'WAP_EXCHANGE_PAGE'://兑换内页
		$format = '/wap/index/ExchangePage?id=%d';
		break;
	case 'WAP_EXCHANGE'://兑换列表
		$format = '/wap/index/Exchange';
		break;
    case 'WAP_DEAL_PAGE'://兑换列表
		$format = '/wap/Exchange/ExchangeDealPage?id=%d';
		break;
	case 'WAP_SHOP_PAGE'://好店内页
		$format = '/wap/index/ShopPage?id=%d';
		break;
    case 'USER_PAGE'://用户主页
		$format = '/wap/user/userpage?uid=%d';
		break;

	//VIP
	case 'VIP_EXCHANGE_PAGE'://兑换内页
		$format = '/vip/exchange/%d';
		break;
	case 'INTE_EX_GOLD'://积分换金币
		$format = '/home.php?model=VipPage&ac=IntegralExchange';
	}

	return vsprintf($format, $args);
}
